home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / MiamiSDK / doc / Miami.doc next >
Text File  |  1997-12-27  |  29KB  |  987 lines

  1. TABLE OF CONTENTS
  2.  
  3. miami.library/--callback hook mechanism for packet monitoring--
  4. miami.library/--general information--
  5. miami.library/--information about T/TCP--
  6. miami.library/freeaddrinfo
  7. miami.library/gai_strerror
  8. miami.library/getaddrinfo
  9. miami.library/gethostbyname2
  10. miami.library/getnameinfo
  11. miami.library/if_freenameindex
  12. miami.library/if_indextoname
  13. miami.library/if_nameindex
  14. miami.library/if_nametoindex
  15. miami.library/inet_aton
  16. miami.library/inet_ntop
  17. miami.library/inet_pton
  18. miami.library/MiamiCloseSSL
  19. miami.library/MiamiDisallowDNS
  20. miami.library/MiamiGetFdCallback
  21. miami.library/MiamiGetHardwareLen
  22. miami.library/MiamiGetPid
  23. miami.library/MiamiGetResOptions
  24. miami.library/MiamiIsOnline
  25. miami.library/MiamiOnOffline
  26. miami.library/MiamiOpenSSL
  27. miami.library/MiamiPFAddHook
  28. miami.library/MiamiPFRemoveHook
  29. miami.library/MiamiSetFdCallback
  30. miami.library/MiamiSetResOptions
  31. miami.library/MiamiSetSocksConn
  32. miami.library/MiamiSupportedCPUs
  33. miami.library/MiamiSupportsIPV6
  34. miami.library/MiamiSysCtl
  35. miami.library/sockatmark
  36. miami.library/--callback hook mechanism for packet monitoring--
  37.  
  38.     Miami 1.9.3 and higher support a simple packet monitoring mechanism.
  39.  
  40.     Miami allows you to add a callback hook that gets called whenever
  41.     Miami is about to send or receive a packet.  This allows you to
  42.     monitor any traffic between Miami and your network interface, to keep
  43.     statistics, and to detect attempts of unauthorized access.
  44.  
  45.     The two functions MiamiPFAddHook() and MiamiPFRemoveHook() are used
  46.     to install and remove a hook, respectively.
  47.  
  48. miami.library/--general information--    miami.library/--general information--
  49.  
  50.     miami.library contains some additional functions to augment
  51.     the API in bsdsocket.library.  The current version of miami.library
  52.     is 12 (for Miami 2.93a).
  53.  
  54. miami.library/--information about T/TCP--
  55.  
  56.     Miami 1.8.1 and higher support T/TCP (TCP for transactions).
  57.  
  58.     To use T/TCP in your programs you first need to check if Miami
  59.     version 1.8.1 is running (by checking if miami.library V3 or higher
  60.     exists).  Then use sendto() calls instead of connect() to establish a
  61.     connection.
  62.  
  63.     For more information please have a look at the example 'ttcptest.c'.
  64.  
  65. miami.library/freeaddrinfo               miami.library/freeaddrinfo
  66.  
  67.    NAME
  68.     freeaddrinfo -- Free an addrinfo structure obtained earlier (V11)
  69.  
  70.    SYNOPSIS
  71.     freeaddrinfo( addrinfo );
  72.               A0
  73.  
  74.     void freeaddrinfo( struct addrinfo *addrinfo );
  75.  
  76.    FUNCTION
  77.     This function frees an address info structure (actually a linked list
  78.     of addrinfo structures) returned earlier by getaddrinfo().
  79.  
  80.    INPUTS
  81.     addrinfo - address info structure
  82.  
  83. miami.library/gai_strerror               miami.library/gai_strerror
  84.  
  85.    NAME
  86.     gai_strerror -- Return the error text corresponding to an addressinfo
  87.     error code (V11)
  88.  
  89.    SYNOPSIS
  90.     str = gai_strerror( error );
  91.     D0            D0
  92.  
  93.     char *gai_strerror( long error );
  94.  
  95.    FUNCTION
  96.     This function returns the error string corresponding to an error
  97.     associated with getaddrinfo() or getnameinfo(), i.e.  one of the
  98.     EAI_...  codes.
  99.  
  100.     The error string returned is located in static storage and does not
  101.     need to be freed.
  102.  
  103.    INPUTS
  104.     error - error code
  105.  
  106.    RESULT
  107.     str (D0) - error string
  108.  
  109. miami.library/getaddrinfo                miami.library/getaddrinfo
  110.  
  111.    NAME
  112.     getaddrinfo -- Look up IP addresses for a host name and service (V11)
  113.  
  114.    SYNOPSIS
  115.     error = getaddrinfo( hostname, servicename, hintsp, result );
  116.     D0             A0        A1        A2        A3
  117.  
  118.     long getaddrinfo( char *hostname, char *servicename, struct addrinfo
  119.         *hintsp, struct addrinfo **result );
  120.  
  121.    FUNCTION
  122.     This function performs a combined host name and service name lookup.
  123.     The result is stored in a linked list of "struct addrinfo".  The
  124.     pointer to the first structure in the list is stored in (*result).
  125.     After use the linked list needs to be freed by calling freeaddrinfo()
  126.     with the first element.
  127.  
  128.     If hintsp is not a NULL pointer then it needs to point to a struct
  129.     addrinfo that contains hints on how the returned result will be used
  130.     by the caller, i.e.  what kind of result the caller is interested in.
  131.     The caller can set ai_flags, ai_family, ai_socktype and ai_protocol.
  132.  
  133.     This function can be used with IPv4 and IPv6 addresses.
  134.  
  135.    INPUTS
  136.     hostname - host name
  137.  
  138.     servicename - service name
  139.  
  140.     hintsp - address hints
  141.  
  142.     result - pointer to return pointer
  143.  
  144.    RESULT
  145.     error (D0) - error code
  146.  
  147. miami.library/gethostbyname2             miami.library/gethostbyname2
  148.  
  149.    NAME
  150.     gethostbyname2 -- Look up IP addresses for a host name (V11)
  151.  
  152.    SYNOPSIS
  153.     hostentry = gethostbyname2( name, family );
  154.     D0                A0      D0
  155.  
  156.     struct hostent *gethostbyname2( char *name, long family );
  157.  
  158.    FUNCTION
  159.     This function is identical to gethostbyname(), except that it accepts
  160.     an additional "address family" parameter, that allows the application
  161.     to indicate what kind of address records should be looked up through
  162.     DNS.  If AF_INET is specified then IPv4 addresses (A records) are
  163.     used.  If AF_INET6 is specified then IPv6 addresses (AAAA records)
  164.     are used.
  165.  
  166.     Please note that the format in which gethostbyname2() returns IP
  167.     addresses also depends on the setting of the RES_USE_INET6 resolver
  168.     option: if that option is set then gethostbyname2() always returns
  169.     IPv6 addresses.  Any IPv4 addresses found (A records) are
  170.     automatically converted into the corresponding IPv6 addresses
  171.     ("IPv4-mapped IPv6 addresses")
  172.  
  173.    INPUTS
  174.     name - host name
  175.  
  176.     family - address family
  177.  
  178.    RESULT
  179.     hostentry (D0) - host entry
  180.  
  181. miami.library/getnameinfo                miami.library/getnameinfo
  182.  
  183.    NAME
  184.     getnameinfo -- Look up host name and service name (V11)
  185.  
  186.    SYNOPSIS
  187.     error = getnameinfo( sockaddr, addrlen, hostname, hostlen,
  188.     D0             A0        D0    A1      D1
  189.         servicename, servicelen, flags );
  190.         A2         D2         D3
  191.  
  192.     long getnameinfo( struct sockaddr *sockaddr, long addrlen, char
  193.         *hostname, long hostlen, char *servicename, long servicelen, long
  194.         flags );
  195.  
  196.    FUNCTION
  197.     This function looks up a host name and a service name corresponding
  198.     to the IP address and port number in the specified sockaddr
  199.     structure, and stores both names in the buffers provided by the
  200.     caller.
  201.  
  202.     flags can be a combination of the NI_...  flags specified in
  203.     <netdb.h>, to control the behavior of getnameinfo().
  204.  
  205.     This function can be used with IPv4 and IPv6 addresses.
  206.  
  207.    INPUTS
  208.     sockaddr - IP address and port
  209.  
  210.     addrlen - length of sockaddr
  211.  
  212.     hostname - buffer for host name
  213.  
  214.     hostlen - length of host name buffer
  215.  
  216.     servicename - buffer for service name
  217.  
  218.     servicelen - length of service name buffer
  219.  
  220.     flags - flags
  221.  
  222.    RESULT
  223.     error (D0) - error code
  224.  
  225. miami.library/if_freenameindex               miami.library/if_freenameindex
  226.  
  227.    NAME
  228.     if_freenameindex -- Frees an array of interface index/name pairs
  229.     (V11)
  230.  
  231.    SYNOPSIS
  232.     if_freenameindex( nameindex );
  233.               D0
  234.  
  235.     void if_freenameindex( struct if_nameindex *nameindex );
  236.  
  237.    FUNCTION
  238.     This function frees an array of interface index/name pairs which was
  239.     previously obtained by calling if_nameindex().
  240.  
  241.    INPUTS
  242.     nameindex - array of index/name pairs
  243.  
  244. miami.library/if_indextoname             miami.library/if_indextoname
  245.  
  246.    NAME
  247.     if_indextoname -- Return the interface name corresponding to an
  248.     interface index (V11)
  249.  
  250.    SYNOPSIS
  251.     name = if_indextoname( index, name );
  252.     D0               D0     A0
  253.  
  254.     char *if_indextoname( long index, char *name );
  255.  
  256.    FUNCTION
  257.     This function stores the name of the interface corresponding to the
  258.     specified interface index in the specified buffer.  That buffer must
  259.     be at least IFNAMSIZ bytes in size.
  260.  
  261.     Upon success a pointer to the interface buffer is returned.  If an
  262.     error occurs (i.e.  if the interface index is invalid) then NULL is
  263.     returned.
  264.  
  265.    INPUTS
  266.     index - interface index
  267.  
  268.     name - buffer for interface name
  269.  
  270.    RESULT
  271.     name (D0) - interface name
  272.  
  273. miami.library/if_nameindex               miami.library/if_nameindex
  274.  
  275.    NAME
  276.     if_nameindex -- Return an array of interface index/name pairs (V11)
  277.  
  278.    SYNOPSIS
  279.     nameindex = if_nameindex();
  280.     D0
  281.  
  282.     struct if_nameindex *if_nameindex (void);
  283.  
  284.    FUNCTION
  285.     This function returns an array of interface index/name pairs,
  286.     describing all interfaces in the system.  The array is terminated by
  287.     a {0,NULL} entry.  After use the array has to be freed by calling
  288.     if_freenameindex().
  289.  
  290.    RESULT
  291.     nameindex (D0) - array of index/name pairs
  292.  
  293. miami.library/if_nametoindex             miami.library/if_nametoindex
  294.  
  295.    NAME
  296.     if_nametoindex -- Return the interface index corresponding to an
  297.     interface name (V11)
  298.  
  299.    SYNOPSIS
  300.     index = if_nametoindex( name );
  301.     D0            A0
  302.  
  303.     long if_nametoindex( char *name );
  304.  
  305.    FUNCTION
  306.     This function returns the interface index (an integer >= 1)
  307.     corresponding to the specified interface name.    If the specified
  308.     interface name is invalid then 0 is returned.
  309.  
  310.    INPUTS
  311.     name - interface name
  312.  
  313.    RESULT
  314.     index (D0) - interface index
  315.  
  316. miami.library/inet_aton                   miami.library/inet_aton
  317.  
  318.    NAME
  319.     inet_aton -- Convert an IPv4 address from ASCII to numeric form (V11)
  320.  
  321.    SYNOPSIS
  322.     success = inet_aton( strptr, addrptr );
  323.     D0             A0      A1
  324.  
  325.     int inet_aton( char *strptr, void *addrptr );
  326.  
  327.    FUNCTION
  328.     This function is similar to inet_addr() in that it converts the ASCII
  329.     representation of an IPv4 address into the corresponding binary form.
  330.     However inet_addr() has one design flaw that is corrected by
  331.     inet_aton(): inet_addr() returns -1 if an error has occured, which is
  332.     identical to the binary representation of 255.255.255.255.  This
  333.     makes it impossible to parse 255.255.255.255 with inet_addr(),
  334.     because the return result would be indistinguishible from an error.
  335.     inet_aton() keeps the output buffer and return code separately,
  336.     making inet_aton() preferable over inet_addr() for new software.
  337.  
  338.     If no error occurs then inet_aton() stores the binary form of the
  339.     specified IP address in the output buffer, and returns 1.  Otherwise
  340.     0 is returned.
  341.  
  342.     Please note that inet_aton() only supports IPv4 addresses.  For IPv4-
  343.     and IPv6-compatible address conversion please use inet_pton().
  344.  
  345.    INPUTS
  346.     strptr - ASCII string
  347.  
  348.     addrptr - output buffer
  349.  
  350.    RESULT
  351.     success (D0) - success
  352.  
  353. miami.library/inet_ntop                   miami.library/inet_ntop
  354.  
  355.    NAME
  356.     inet_ntop -- Convert an IP address from numeric to ASCII form (V11)
  357.  
  358.    SYNOPSIS
  359.     strptr = inet_ntop( family, addrptr, strptr, len );
  360.     D0            D0        A0         A1      D1
  361.  
  362.     char *inet_ntop( long family, void *addrptr, char *strptr, long len
  363.         );
  364.  
  365.    FUNCTION
  366.     This function is similar to inet_ntoa() in that it converts the
  367.     binary representation of an IP address into a suitable ASCII
  368.     representation.  However inet_ntop() not only supports IPv4
  369.     addresses, but also IPv6 addresses (if the protocol stack supports
  370.     IPv6), making inet_ntop() preferable over inet_ntoa() for new
  371.     software.
  372.  
  373.     The parameter "family" can be AF_INET or AF_INET6, indicating an IPv4
  374.     or IPv6 address.
  375.  
  376.     If no error occurs then inet_ntop() stores the ASCII representation
  377.     of the specified IP address in the output buffer, and returns the
  378.     address of the output buffer.  Otherwise NULL is returned.
  379.  
  380.    INPUTS
  381.     family - address family
  382.  
  383.     addrptr - IP address
  384.  
  385.     strptr - output buffer
  386.  
  387.     len - length of output buffer
  388.  
  389.    RESULT
  390.     strptr (D0) - return buffer
  391.  
  392. miami.library/inet_pton                   miami.library/inet_pton
  393.  
  394.    NAME
  395.     inet_pton -- Convert an IP address from ASCII to numeric form (V11)
  396.  
  397.    SYNOPSIS
  398.     success = inet_pton( family, strptr, addrptr );
  399.     D0             D0      A0      A1
  400.  
  401.     int inet_pton( long family, char *strptr, void *addrptr );
  402.  
  403.    FUNCTION
  404.     This function is similar to inet_aton() and inet_addr() in that it
  405.     converts the ASCII representation of an IP address into the
  406.     corresponding binary form.  However inet_pton() not only supports
  407.     IPv4 addresses, but also IPv6 addresses (if the protocol stack
  408.     supports IPv6), making inet_pton() preferable over inet_aton() or
  409.     inet_addr() for new software.
  410.  
  411.     The parameter "family" can be AF_INET or AF_INET6, indicating an IPv4
  412.     or IPv6 address.
  413.  
  414.     If no error occurs then inet_pton() stores the binary form of the
  415.     specified IP address in the output buffer, and returns 1.  Otherwise
  416.     0 is returned.
  417.  
  418.    INPUTS
  419.     family - address family
  420.  
  421.     strptr - ASCII string
  422.  
  423.     addrptr - output buffer
  424.  
  425.    RESULT
  426.     success (D0) - success
  427.  
  428. miami.library/MiamiCloseSSL              miami.library/MiamiCloseSSL
  429.  
  430.    NAME
  431.     MiamiCloseSSL -- closes the SSL library (V7)
  432.  
  433.    SYNOPSIS
  434.     MiamiCloseSSL();
  435.  
  436.  
  437.     void MiamiCloseSSL (void);
  438.  
  439.    FUNCTION
  440.     Closes the SSL library which was previously opened by a call to
  441.     MiamiOpenSSL.  You MAY NOT call CloseLibrary directly to close the
  442.     SSL library.
  443.  
  444. miami.library/MiamiDisallowDNS               miami.library/MiamiDisallowDNS
  445.  
  446.    NAME
  447.     MiamiDisallowDNS -- disallow DNS lookups for gethostbyaddr.  (V3)
  448.  
  449.    SYNOPSIS
  450.     MiamiDisallowDNS( value );
  451.               D0
  452.  
  453.     void MiamiDisallowDNS( long value );
  454.  
  455.    FUNCTION
  456.     Prevents Miami from performing any external DNS lookups (i.e.  from
  457.     contacting DNS servers) for all subsequent calls to gethostbyaddr().
  458.     A 'value' of TRUE disallows DNS lookups, i.e.  prevents Miami from
  459.     doing DNS lookups.  A 'value' of FALSE reenables DNS lookups again.
  460.  
  461.     Calls to MiamiDisallowDNS do NOT nest, i.e.  if you call the function
  462.     multiple times with a 'value' of TRUE, then a single call with a
  463.     'value' of FALSE will reenable DNS lookups.
  464.  
  465.     While DNS lookups are deactivated gethostbyaddr() still returns
  466.     non-zero values for IP addresses which are either in the 'hosts'
  467.     database, or which are in Miami's DNS cache.
  468.  
  469.     MiamiDisallowDNS is primarily useful for diagnostic tools that know
  470.     an IP address and need to report this address to the user in a more
  471.     user-friendly way (i.e.  including the host name), but which would
  472.     rather report the IP address by itself than wait for a DNS lookup to
  473.     complete.  One such example is 'MiamiNetStat' with the '-N' flag set.
  474.  
  475.    INPUTS
  476.     value - boolean: disallow DNS lookups
  477.  
  478.    EXAMPLE
  479.     MiamiDisallowDNS(TRUE);
  480.  
  481. miami.library/MiamiGetFdCallback         miami.library/MiamiGetFdCallback
  482.  
  483.    NAME
  484.     MiamiGetFdCallback -- Return the current FD callback (V12)
  485.  
  486.    SYNOPSIS
  487.     cputype = MiamiGetFdCallback( cbptr );
  488.     D0                  A0
  489.  
  490.     long MiamiGetFdCallback( void **cbptr );
  491.  
  492.    FUNCTION
  493.     This function returns a pointer to the current FD callback function
  494.     in (*cbptr), and the CPU type of that callback (one of MIAMICPU_...)
  495.     as a return value of the function call.  If no callback is currently
  496.     set then (*cbptr) is set to NULL and the CPU type 0 is returned.
  497.  
  498.     This function is a replacement for the deprecated SocketBase option
  499.     SBTM_GETVAL(SBTC_FDCALLBACK), which does not handle mixed-CPU setups.
  500.  
  501.    INPUTS
  502.     cbptr - returned callback ptr
  503.  
  504.    RESULT
  505.     cputype (D0) - cpu type of callback
  506.  
  507. miami.library/MiamiGetHardwareLen        miami.library/MiamiGetHardwareLen
  508.  
  509.    NAME
  510.     MiamiGetHardwareLen -- return the hardware address length.  (V5)
  511.  
  512.    SYNOPSIS
  513.     len = MiamiGetHardwareLen( name );
  514.     D0               A0
  515.  
  516.     int MiamiGetHardwareLen( char *name );
  517.  
  518.    FUNCTION
  519.     This function returns the length of the hardware address (Ethernet
  520.     address, Arcnet address etc.) for the specified interface in bytes.
  521.  
  522.    INPUTS
  523.     name - interface name
  524.  
  525.    RESULT
  526.     len (D0) - hardware address len
  527.  
  528. miami.library/MiamiGetPid                miami.library/MiamiGetPid
  529.  
  530.    NAME
  531.     MiamiGetPid -- return Miami's internal process descriptor.  (V5)
  532.  
  533.    SYNOPSIS
  534.     pid = MiamiGetPid();
  535.     D0
  536.  
  537.     void *MiamiGetPid (void);
  538.  
  539.    FUNCTION
  540.     Miami associates an internal process descriptor which each opener.
  541.     Usually you should not care about this value, but there is one case
  542.     when it is useful to know what your process descriptor is:
  543.  
  544.     If your program manipulates routes directly (through routing
  545.     sockets), then the member "rtm_pid" of "struct rt_msghdr" contains
  546.     the process descriptor of the process that caused the routing
  547.     message.  You can compare this value against the value returned by
  548.     MiamiGetPid() to distinguish new (aynchronous) routing messages from
  549.     responses to your own routing messages.
  550.  
  551.    RESULT
  552.     pid (D0) - process descriptor
  553.  
  554. miami.library/MiamiGetResOptions         miami.library/MiamiGetResOptions
  555.  
  556.    NAME
  557.     MiamiGetResOptions -- Return the current resolver options (V11)
  558.  
  559.    SYNOPSIS
  560.     options = MiamiGetResOptions();
  561.     D0
  562.  
  563.     long MiamiGetResOptions (void);
  564.  
  565.    FUNCTION
  566.     This function returns the current resolver options.  CAUTION: the
  567.     returned value may contain bits which are not listed in
  568.     <arpa/resolv.h>, i.e.  *undocumented* options.    Such options are off
  569.     limits to the caller: don't touch or change.
  570.  
  571.    RESULT
  572.     options (D0) - resolver options
  573.  
  574. miami.library/MiamiIsOnline              miami.library/MiamiIsOnline
  575.  
  576.    NAME
  577.     MiamiIsOnline -- checks whether an interface is online (V10)
  578.  
  579.    SYNOPSIS
  580.     result = MiamiIsOnline( name );
  581.     D0            A0
  582.  
  583.     int MiamiIsOnline( char *name );
  584.  
  585.    FUNCTION
  586.     This function returns TRUE if the specified interface exists and is
  587.     online, FALSE otherwise.  Currently only interface names "lo0" and
  588.     "mi0" are valid.  This will change in Miami Deluxe though.
  589.  
  590.    INPUTS
  591.     name - interface name
  592.  
  593.    RESULT
  594.     result (D0) - result code
  595.  
  596. miami.library/MiamiOnOffline             miami.library/MiamiOnOffline
  597.  
  598.    NAME
  599.     MiamiOnOffline -- checks whether an interface is online (V10)
  600.  
  601.    SYNOPSIS
  602.     MiamiOnOffline( name, online );
  603.             A0    D0
  604.  
  605.     void MiamiOnOffline( char *name, int online );
  606.  
  607.    FUNCTION
  608.     This function tells Miami to change the online state of the specified
  609.     interface.  Passing TRUE tells Miami to try and go online, passing
  610.     FALSE tells Miami to try and go online with the specified interface.
  611.     Currently only interface names "lo0" and "mi0" are valid.  This will
  612.     change in Miami Deluxe though.
  613.  
  614.     Please note that this function is asynchronous.  It returns
  615.     immediately, and does not wait for the online/offline process to
  616.     complete.
  617.  
  618.    INPUTS
  619.     name - interface name
  620.  
  621.     online - online status
  622.  
  623. miami.library/MiamiOpenSSL               miami.library/MiamiOpenSSL
  624.  
  625.    NAME
  626.     MiamiOpenSSL -- opens the SSL library (V7)
  627.  
  628.    SYNOPSIS
  629.     ssllib = MiamiOpenSSL( taglist );
  630.     D0               A0
  631.  
  632.     struct Library *MiamiOpenSSL( struct TagItem *taglist );
  633.  
  634.    FUNCTION
  635.     This function attempts to open and initialize the SSL library for the
  636.     current caller.  A non-NULL return value indicates that the library
  637.     was successfully opened, and that the returned library base can be
  638.     used for MiamiSSL function calls.  A NULL return value indicates that
  639.     the SSL library could not be opened.
  640.  
  641.     You MAY NOT open the SSL library manually by calling OpenLibrary
  642.     directly.
  643.  
  644.     To close the SSL library call the function MiamiCloseSSL, NOT
  645.     CloseLibrary.
  646.  
  647.     No TagItems are currently defined, i.e.  you should pass a NULL
  648.     pointer or an empty TagList.
  649.  
  650.    INPUTS
  651.     taglist - list of TagItems
  652.  
  653.    RESULT
  654.     ssllib (D0) - SSL library base
  655.  
  656. miami.library/MiamiPFAddHook             miami.library/MiamiPFAddHook
  657.  
  658.    NAME
  659.     MiamiPFAddHook -- add a packet monitoring hook.  (V5)
  660.  
  661.    SYNOPSIS
  662.     handle = MiamiPFAddHook( hook, interface, taglist );
  663.     D0             A0    A1      A2
  664.  
  665.     APTR MiamiPFAddHook( struct Hook *hook, UBYTE *interface, struct
  666.         TagItem *taglist );
  667.  
  668.    FUNCTION
  669.     This function adds a callback hook to monitor all traffic on the
  670.     specified interface.  'hook' has to be a pointer to an initialized
  671.     'struct Hook' defining the function that is called for each packet
  672.     sent or transmitted across the specified interface.  Each hook can
  673.     only be used for a single interface at a time, but you may add more
  674.     than one hook for each interface.
  675.  
  676.     'interface' is a pointer to an ASCIZ string that contains the name of
  677.     the interface to be monitored, currently either "mi0" or "lo0".
  678.  
  679.     'taglist' is a pointer to a list of TagItems.  Currently the
  680.     following TagItems are supported:
  681.  
  682.     MIAMITAG_HOOKTYPE (V12): defines the type of hook.  Allowed is any
  683.     MIAMICPU_...  value which was previously returned in the "callbacks"
  684.     item of a call to MiamiSupportedCPUs().  The default is
  685.     MIAMICPU_M68KREG.
  686.  
  687.     'handle' is an opaque identifier that you need in order to remove
  688.     your hook later.  Do not make any assumptions about the meaning of
  689.     'handle'.  'handle' will be NULL if Miami was unable to add your
  690.     hook.
  691.  
  692.     M68KREG hooks are called with the following parameters:
  693.  
  694.     - A0: struct Hook *: your struct Hook
  695.  
  696.     - A2: APTR: your callback handle
  697.  
  698.     - A1: struct MiamiPFBuffer *: a pointer to an initialized struct
  699.       MiamiPFBuffer describing the packet sent or received.
  700.  
  701.     PPCV4 hooks are called with the same parameters as M68KREG hooks, in
  702.     the same order as listed above, but according to PPC-V.4 calling
  703.     conventions, i.e.  you should NOT use the "__asm" keyword in the
  704.     declaration of your callback function.
  705.  
  706.    INPUTS
  707.     hook - callback hook
  708.  
  709.     interface - interface name to be monitored
  710.  
  711.     taglist - list of TagItems
  712.  
  713.    RESULT
  714.     handle (D0) - callback handle
  715.  
  716.    NOTE
  717.     You MAY NOT modify the contents of the buffer passed to you in the
  718.     hook.  Doing so may have unpredictable side effects including
  719.     crashes.
  720.  
  721.     You MUST remove each installed hook before closing miami.library.
  722.     This will NOT be done for you automatically.
  723.  
  724.     Your hook may be called on a task schedule other than your own task.
  725.     Be prepared for a small stack, for having just a task (not a
  726.     process), or for having an unusually low or high task priority.  Also
  727.     remember to properly set up the runtime environment required by your
  728.     compiler (e.g.    __saveds) and to switch off stack checking for the
  729.     hook function.
  730.  
  731.     From your hook you may NOT call any function that might directly or
  732.     indirectly get blocked within miami.library or bsdsocket.library,
  733.     i.e.  you may NOT call functions like WaitSelect(), send() etc.  from
  734.     your hook.  It is strongly recommended NOT to do any DOS I/O or
  735.     socket I/O at all from the hook.
  736.  
  737.     Packet monitoring can only be used with the registered version of
  738.     Miami.    In the unregistered version this function always returns
  739.     NULL.
  740.  
  741. miami.library/MiamiPFRemoveHook           miami.library/MiamiPFRemoveHook
  742.  
  743.    NAME
  744.     MiamiPFRemoveHook -- remove a packet monitoring hook.  (V5)
  745.  
  746.    SYNOPSIS
  747.     MiamiPFRemoveHook( handle );
  748.                A0
  749.  
  750.     void MiamiPFRemoveHook( APTR handle );
  751.  
  752.    FUNCTION
  753.     This function removes a callback hook which was previously added by
  754.     calling MiamiPFAddHook.
  755.  
  756.     You MUST call MiamiPFRemoveHook exactly once for each hook added
  757.     earlier before closing miami.library.
  758.  
  759.    INPUTS
  760.     handle - callback handle
  761.  
  762. miami.library/MiamiSetFdCallback         miami.library/MiamiSetFdCallback
  763.  
  764.    NAME
  765.     MiamiSetFdCallback -- Set the current FD callback (V12)
  766.  
  767.    SYNOPSIS
  768.     success = MiamiSetFdCallback( cbptr, cputype );
  769.     D0                  A0     D0
  770.  
  771.     long MiamiSetFdCallback( void *cbptr, long cputype );
  772.  
  773.    FUNCTION
  774.     This function sets the current FD callback function to "cbptr", and
  775.     the CPU type of that callback (one of MIAMICPU_...) to "cputype".
  776.     The function returns TRUE for success and FALSE for failure (usually
  777.     because of an unsupported CPU type).
  778.  
  779.     This function is a replacement for the deprecated SocketBase option
  780.     SBTM_SETVAL(SBTC_FDCALLBACK), which does not handle mixed-CPU setups.
  781.  
  782.    INPUTS
  783.     cbptr - callback ptr
  784.  
  785.     cputype - cpu type of callback
  786.  
  787.    RESULT
  788.     success (D0) - success indicator
  789.  
  790. miami.library/MiamiSetResOptions         miami.library/MiamiSetResOptions
  791.  
  792.    NAME
  793.     MiamiSetResOptions -- Sets the current resolver options (V11)
  794.  
  795.    SYNOPSIS
  796.     MiamiSetResOptions( options );
  797.                 D0
  798.  
  799.     void MiamiSetResOptions( long options );
  800.  
  801.    FUNCTION
  802.     This function sets the current resolver options.  CAUTION: The ONLY
  803.     approved use of this function is as follows: get the current resolver
  804.     options by calling MiamiGetResOptions(), change the state of some
  805.     bits, then call MiamiSetResOptions() with the new value.  NEVER
  806.     change bits that are not documented, and NEVER call
  807.     MiamiSetResOptions() without getting the current options first.
  808.  
  809.    INPUTS
  810.     options - resolver options
  811.  
  812. miami.library/MiamiSetSocksConn           miami.library/MiamiSetSocksConn
  813.  
  814.    NAME
  815.     MiamiSetSocksConn -- set destination address for SOCKS.  (V10)
  816.  
  817.    SYNOPSIS
  818.     success = MiamiSetSocksConn( sa, len );
  819.     D0                 A0  D0
  820.  
  821.     int MiamiSetSocksConn( struct sockaddr *sa, int len );
  822.  
  823.    FUNCTION
  824.     This function sets the destination address for the next SOCKS bind()
  825.     request.  You only need to call this function if you want your
  826.     program to work with SOCKS, and your program accepts connections from
  827.     a machine without first establishing an outbound connection
  828.     (connect()) to that machine, from the same bsdsocket.library opener
  829.     process.  One example application is IRC-DCC.
  830.  
  831.     Pass the address of the target machine (the machine you are accepting
  832.     the connection from) and the address length.  The function returns
  833.     TRUE only if SOCKS is active and the function succeeded, FALSE in all
  834.     other cases (e.g.  if SOCKS was not used).
  835.  
  836.    INPUTS
  837.     sa - target address
  838.  
  839.     len - address length
  840.  
  841.    RESULT
  842.     success (D0) - success
  843.  
  844. miami.library/MiamiSupportedCPUs         miami.library/MiamiSupportedCPUs
  845.  
  846.    NAME
  847.     MiamiSupportedCPUs -- Check which CPUs are supported by Miami (V12)
  848.  
  849.    SYNOPSIS
  850.     MiamiSupportedCPUs( apis, callbacks, kernel );
  851.                 A0      A1         A2
  852.  
  853.     void MiamiSupportedCPUs( unsigned long *apis, unsigned long
  854.         *callbacks, unsigned long *kernel );
  855.  
  856.    FUNCTION
  857.     This function checks which CPUs are supported by Miami for different
  858.     purposes.  The function returns three bit masks with the following
  859.     meanings:
  860.  
  861.     apis: application programming interfaces supported to access Miami.
  862.     MIAMICPU_M68KREG is the standard 680x0 exec shared library model,
  863.     including bsdsocket.library, miami.library and usergroup.library.
  864.     MIAMICPU_PPCV4 is a V.4-based access mechanism for PowerPC (yet to be
  865.     defined).
  866.  
  867.     callbacks: types of callbacks supported by Miami.  MIAMICPU_M68KREG
  868.     are standard 680x0 exec-style callbacks, parameters passed in
  869.     registers.  MIAMICPU_PPCV4 uses PowerPC callbacks with V.4 ABI
  870.     paramater passing conventions.    Note that for compatibility with
  871.     Phase5's PowerUp calling conventions Miami always uses 680x0
  872.     exec-style callbacks as the default, regardless of the API used, i.e.
  873.     even for a PPC API.  Applications which want to use callbacks other
  874.     than MIAMICPU_M68KREG need to specify the type of callback when
  875.     installing the callback hook.
  876.  
  877.     kernel: CPUs used for the implementation of the kernel, i.e.  the
  878.     CPUs which execute most of the code in the kernel.  Using one of the
  879.     models listed here for APIs and callbacks may provide better
  880.     performance than other models listed in "apis" or "callbacks".
  881.  
  882.    INPUTS
  883.     apis - supported APIs
  884.  
  885.     callbacks - supported callbacks
  886.  
  887.     kernel - supported CPUs in kernel
  888.  
  889. miami.library/MiamiSupportsIPV6           miami.library/MiamiSupportsIPV6
  890.  
  891.    NAME
  892.     MiamiSupportsIPV6 -- Check if IPv6 is supported (V11)
  893.  
  894.    SYNOPSIS
  895.     success = MiamiSupportsIPV6();
  896.     D0
  897.  
  898.     long MiamiSupportsIPV6 (void);
  899.  
  900.    FUNCTION
  901.     This function returns TRUE if IPv6 is supported by this protocol
  902.     stack, and FALSE otherwise.
  903.  
  904.    RESULT
  905.     success (D0) - success
  906.  
  907. miami.library/MiamiSysCtl                miami.library/MiamiSysCtl
  908.  
  909.    NAME
  910.     MiamiSysCtl -- read or write system parameters (V3)
  911.  
  912.    SYNOPSIS
  913.     error = MiamiSysCtl( name, namelen, oldp, oldlenp, newp, newlen,
  914.     D0             A0    D0        A1      A2       A3     D1
  915.         len );
  916.         D0
  917.  
  918.     int MiamiSysCtl( long *name, unsigned long namelen, void *oldp, long
  919.         *oldlenp, void *newp, long newlen, int len );
  920.  
  921.    FUNCTION
  922.     This function allows the application to examine and change system
  923.     parameters, which are defined by their position in a system-wide
  924.     object tree.  The "name" parameter does not point to a character
  925.     string, but to an array of long definining the position of the object
  926.     within the object tree.
  927.  
  928.     For instance the object "net.inet.ip.forwarding" would be defined by
  929.     the name array {CTL_NET,AF_INET,IPPROTO_IP,IPCTL_FORWARDING}, with a
  930.     length of 4.
  931.  
  932.     To fetch a value, oldp points to a buffer into which Miami stores the
  933.     value.    oldlenp is a value-result argument: when the function is
  934.     called the value pointed to by oldlenp specifies the size of the
  935.     buffer, and on return the value contains the amount of data stored in
  936.     the buffer by Miami.  If the buffer is not large enough an error (-1)
  937.     is returned, with errno set to ENOMEM.
  938.  
  939.     As a special case, oldp can be a null pointer, and oldlenp a nonnull
  940.     pointer, and Miami determines how much data the call would have
  941.     returned, and returns this size through oldlenp.
  942.  
  943.     To set a new value, newp points to a buffer of size newlen.  If a new
  944.     value is not being specified, newp should be a null pointer, and
  945.     newlen should be 0.
  946.  
  947.    INPUTS
  948.     name - object name
  949.  
  950.     namelen - length of object name
  951.  
  952.     oldp - buffer for old value
  953.  
  954.     oldlenp - pointer to length of buffer for old value
  955.  
  956.     newp - buffer for new value
  957.  
  958.     newlen - length of buffer for new value
  959.  
  960.     len - address length
  961.  
  962.    RESULT
  963.     error (D0) - error code
  964.  
  965. miami.library/sockatmark                 miami.library/sockatmark
  966.  
  967.    NAME
  968.     sockatmark -- Check if socket is at an out-of-band mark (V11)
  969.  
  970.    SYNOPSIS
  971.     result = sockatmark( sockfd );
  972.     D0             D0
  973.  
  974.     long sockatmark( long sockfd );
  975.  
  976.    FUNCTION
  977.     This function checks if the receive stream of the specified socket is
  978.     currently at the out-of-band mark.  The function returns 1 in that
  979.     case, 0 otherwise.
  980.  
  981.    INPUTS
  982.     sockfd - socket descriptor
  983.  
  984.    RESULT
  985.     result (D0) - result code
  986.  
  987.